package gt.edu.usac.viewcontroller.backing;

import gt.edu.usac.viewcontroller.Globales;

import java.io.IOException;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class logout {
    public logout() {
    }

    public String logoutButton_action()  throws IOException{
        ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
        HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
        HttpSession session = (HttpSession)ectx.getSession(false);
        session.invalidate();
        
        response.sendRedirect("../faces/app/Inicio.jsp");
        return null;
    }
}
